{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "import docclass as docclass"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from feedfilter import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "#feed='http://feed.cnblogs.com/blog/sitehome/rss'\n",
    "feed='python_search.xml'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#f=feedparser.parse('http://feed.cnblogs.com/blog/sitehome/rss')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "cl01=docclass.fisherclassifier(docclass.getwords)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "cl01.setdb('python_cnblog.db')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-----\n",
      "Title:     My new baby boy!\n",
      "Publisher: Shetan Noir, the zombie belly dancer! - MySpace Blog\n",
      "THis is my new baby, Anthem. He is a 3 and half month old ball <b>python</b>, orange shaded normal pattern. I have held him about 5 time since I brought him home tonight at 8:00pm...\n",
      "Guess: None\n",
      "Enter category: baby\n",
      "-----\n",
      "Title:     If you need a laugh...\n",
      "Publisher: Kate&#39;s space\n",
      "Even does 'funny walks' from Monty <b>Python</b>. He talks about all the ol' ladies that are after him. He teases me about my horror obsession. He attempts suicide. And best of all, he talks about poo. Who doesn't think poo is funny???!\n",
      "Guess: baby\n",
      "Enter category: funny\n",
      "-----\n",
      "Title:     And another one checked off the list..New pix comment ppl\n",
      "Publisher: Python Guru - MySpace Blog\n",
      "Now the one of a kind NERD bred Carplot male is in our possesion. His name is Broken (not because he is sterile) lol But check out the pic and leave one bitches..............\n",
      "Guess: baby\n",
      "Enter category: Nerd\n",
      "-----\n",
      "Title:     <b>Python</b> vs Java - It’s not only the language, it’s the tools\n",
      "Publisher: A Drop In The Stream\n",
      "Well, I’ve done a bit of <b>Python</b> coding by now in my new job and here’s my take on the <b>Python</b> vs. Java question. <b>Python</b> is concise and just rocks for doing tricky, complicated things using simple semantics. I just learned of a chunk of <b>...</b>\n",
      "Guess: Nerd\n"
     ]
    }
   ],
   "source": [
    "read(feed,cl01)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
